﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pocos = GigaMatchTestPocos;
using System.Data.Entity.Infrastructure;
using System.Data;
using System.Data.Entity;

namespace GigaMatchTestDAL
{
    public class GMDataContext : IDisposable    
    {
        public object dc { get; set; }

        public GMDataContext()
        {
            dc = new Pocos.GigaMatchTestEntities();
            ((DbContext)dc).Configuration.LazyLoadingEnabled = false;
            ((DbContext)dc).Configuration.AutoDetectChangesEnabled = false;
        }

        public void SaveChanges()
        {
            ((Pocos.GigaMatchTestEntities)dc).SaveChanges();
        }

        #region IDisposable Members

        public void Dispose()
        {
            SaveChanges();
        }

        #endregion
    }
}
